<?php
/**
 * Created by PhpStorm.
 * User: 13469
 * Date: 2018/10/6
 * Time: 13:49
 */
include "config.php";
if($_SERVER["REQUEST_METHOD"]=="POST"){
    if(isset($_POST["tel"])&&isset($_POST["pwd"])){
        $sql="INSERT INTO userinfo (u_tel,u_pwd)VALUES(?,?);";
        $stmt=$conn->prepare($sql);
        $stmt->bind_param("ss",$_POST["tel"],$_POST["pwd"]);
        $stmt->execute();
        if($stmt->affected_rows>=1){
            print_r(json_encode(array("status"=>1,"msg"=>"注册成功")));
        }else{
            print_r(json_encode(array("status"=>0,"msg"=>"注册失败")));
        }
        $stmt->close();
    }
}else{
    print_r(json_encode(array("status"=>-1,"msg"=>"不支持get请求")));
}
        $conn->close();